package com.example.flow.utils;

import com.example.flow.constant.FlowConstant;
import com.example.flow.flow.core.Execution;

/**
 * @author safe
 * @date 2021/1/31
 */
public class FlowUtil {
    /**
     * 获取流程实例编号
     *
     * @param execution
     * @return
     */
    public static String getOrderId(Execution execution) {
        return execution.getOrder()
                .getOrderId();
    }

    /**
     * 获取流程审批编号
     *
     * @param execution
     * @return
     */
    public static String getApplyId(Execution execution) {
        return (String) execution.getArgs()
                .get(FlowConstant.APPLY_ID);
    }
}
